//
//  ApiClient+Ext.h
//  ChunLaiZhuangClient
//
//  Created by zzs on 16/3/17.
//  Copyright © 2016年 CLZ. All rights reserved.
//

#import "ApiClient.h"
#import "SearchHotWordModel.h"
#import "SearchResultModel.h"
#import "ProdcutListCategoryModel.h"
#import "AccountModel.h"
#import "BrandGroupModel.h"
#import "BrandsGroupZiMuModel.h"
#import "AccountOrdersModel.h"
#import "OrderPayModel.h"
#import "ClassModel.h"
#import "HomeModel.h"
#import "AreaModel.h"
#import "AddressListModel.h"
#import "CouponListModel.h"
#import "CommentListModel.h"
#import "ProdcutDetaiModel.h"
#import "CartListModel.h"
#import "PayModel.h"
#import "FirstCategoryModel.h"
#import "CheckoutModel.h"
#import "ProductPriceModel.h"
#import "CollectionModel.h"
#import "JudgeModel.h"
#import "CartCountModel.h"
#import "OrderDetailModel.h"
#import "ExpressInfoModel.h"
typedef void (^didFinishLoaded)(KXJson *json, NSString *path);
typedef void (^didFailLoaded)(NSError *error, NSString *path);
typedef void (^searchHotWordModel)(SearchHotWordModel *model, NSString *path);
typedef void (^searchResultModel)(SearchResultModel *model, NSString *path);
typedef void (^prodcutListCategoryModel)(ProdcutListCategoryModel *model, NSString *path);
typedef void (^accountModel)(AccountModel *model, NSString *path);
typedef void (^brandGroupModel)(BrandGroupModel *model, NSString *path);
typedef void (^brandsGroupZiMuModel)(BrandsGroupZiMuModel *model, NSString *path);
typedef void (^accountOrdersModel)(AccountOrdersModel *model, NSString *path);
typedef void (^orderPayModel)(OrderPayModel *model, NSString *path);
typedef void (^orderPayModel)(OrderPayModel *model, NSString *path);
typedef void (^classModel)(ClassModel *model, NSString *path);
typedef void (^homeModel)(HomeModel *model, NSString *path);
typedef void (^areaListModel)(AreaModel *model, NSString *path);
typedef void (^addressListModel)(AddressListModel *model, NSString *path);
typedef void (^couponListModel)(CouponListModel *model, NSString *path);
typedef void (^productDetailModel)(ProdcutDetaiModel *model, NSString *path);
typedef void (^commentListModel)(CommentListModel *model, NSString *path);
typedef void (^cartListModel)(CartListModel *model, NSString *path);
typedef void (^cartCountModel)(CartCountModel *model, NSString *path);
typedef void (^orderConfirmModel)(PayModel *model, NSString *path);
typedef void (^firstCategoryModel)(FirstCategoryModel *model, NSString *path);
typedef void (^checkoutModel)(CheckoutModel *model, NSString *path);
typedef void (^productPriceModel)(ProductPriceModel *model, NSString *path);
typedef void (^collectionModel)(CollectionModel *model, NSString *path);
typedef void (^judgeModel)(JudgeModel *model, NSString *path);
typedef void (^orderDetailModel)(OrderDetailModel *model, NSString *path);
typedef void (^expressInfoModel)(ExpressInfoModel *model, NSString *path);
@interface ApiClient (Ext)
#pragma mark-首页
+(void)getHomeDataDidFinishLoaded:(homeModel)finish didFailLoaded:(didFailLoaded)fail;
/**
 *  搜索首页,将热门搜索关键字列表显示出来
 *
 *  @param finish 成功
 *  @param fail   失败
 */
+ (void)getSearchHotWordDidFinishLoaded:(searchHotWordModel)finish didFailLoaded:(didFailLoaded)fail;
/**
 *  搜索结果
 *
 *  @param keyword 关键字
 *  @param sort    //排序类型,可选参数:name/price/rating/model(可选)
 *  @param order   //排序方式:可选参数:ASC/DESC(可选,默认为 ASC)
 *  @param page    //页数,从 1 开始(可选,默认为 1)
 *  @param finish  成功
 *  @param fail    失败
 */
+ (void)getSearchResultKeyword:(NSString*)keyword Sort:(NSString*)sort order:(NSString*)order page:(NSString*)page DidFinishLoaded:(searchResultModel)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-注册
/**
 *  注册
 *
 *  @param telephone 电话
 *  @param sms       短信
 *  @param password  密码
 *  @param finish    成功
 *  @param fail      失败
 */
+(void)registerNewUserTelephone:(NSString*)telephone sms:(NSString*)sms password:(NSString*)password DidFinishLoaded:(accountModel)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-注册时发送手机验证码
+(void)sendRegiseterSmsTelephone:(NSString*)tel didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;


#pragma mark-登录
/**
 *  登录
 *
 *  @param account  账户名
 *  @param password 密码
 *  @param finish   成功
 *  @param fail     失败
 */
+(void)loginWithAccount:(NSString*)account password:(NSString*)password didFinishLoaded:(accountModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-退出登录
+(void)loginOutDidFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-重置密码（忘记密码）
/**
 *  重置密码
 *
 *  @param phone  电话
 *  @param finish 成功
 *  @param fail   失败
 */
+(void)forgetPasswordWithPhone:(NSString*)phone sms:(NSString*)sms password:(NSString*)password didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-通过手机号码重设密码时，使用此接口先发送短信，测试统一返回 123456
+(void)sendForgottenSmsTelephone:(NSString*)tel didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;



#pragma mark-分类
/**
 *  获取所有级分类的列表
 *
 *  @param finish 成功
 *  @param fail   失败
 */
+(void)getAllCategoriesDidFinishLoaded:(classModel)finish didFailLoaded:(didFailLoaded)fail;
/**
 *  获取一级分类
 *
 *  @param finish 成功
 *  @param fail   失败
 */
+(void)getAllFirstCategoriesDidFinishLoaded:(firstCategoryModel)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-根据分类ID获取产品列表
/**
 *  根据分类ID获取产品列表
 *
 *  @param category_id 分类 ID 号(必填)
 *  @param sort        排列类型(可选,参数:name/price/rating/model/sale)
 *  @param order       排列方式(可选,参数:DESC/ASC)
 *  @param page        页数(可选,默认为 1)
 *  @param finish      成功
 *  @param fail        失败
 */
+(void)getProductListCategory_id:(NSString*)category_id sort:(NSString*)sort order:(NSString*)order page:(NSString*)page didFinishLoaded:(prodcutListCategoryModel)finish didFailLoaded:(didFailLoaded)fail;



#pragma mark-获取所有品牌(不使用)
/**
 *  获取所有品牌
 *
 *  @param finish 成功
 *  @param fail   失败
 */
+(void)getAllBrandsDidFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-获取单个品牌的商品列表，支持分页和排序
+(void)getProductBrand_id:(NSString*)brand_id sort:(NSString*)sort order:(NSString*)order page:(NSString*)page didFinishLoaded:(prodcutListCategoryModel)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-品牌列表-按后台标签分组显示
+(void)getBrandsGroupedDidFinishLoaded:(brandGroupModel)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-品牌列表-按拼音首字母分组显示
+(void)getBrandsGroupZiMuDidFinishLoaded:(brandsGroupZiMuModel)finish didFailLoaded:(didFailLoaded)fail;

#pragma 获取省和城市列表
+(void)getProvinceAndCityList:(areaListModel)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-收货地址
+(void)getAddressListDidFinishLoaded:(addressListModel)finish didFailLoaded:(didFailLoaded)fail;
+(void)setDefaultAddress:(NSString *)addressId didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)deleteAddress:(NSString *)addressId didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)addAddress:(NSMutableDictionary *)params didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-个人中心-获取邀请码[需登录]
+(void)getInvitationInfoDidFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-个人中心-保存邀请码[需登录]
+(void)saveInvitationCode:(NSString*)code DidFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-个人中心-获取个人信息
+(void)getAccountInfoDidFinishLoaded:(accountModel)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-个人中心-收藏列表
+(void)getCollectionListPage:(NSString*)page didFinishLoaded:(collectionModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-个人中心-已评论的商品列表
+(void)getHaveCommentListPageNumber:(NSString*)page didFinishLoaded:(commentListModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-待评价商品列表
+(void)getWaitCommentListPageNumber:(NSString*)page didFinishLoaded:(judgeModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-个人中心-用户输入邀请码，可绑定由谁推荐。
+(void)bindInvitationCodeDidFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-通过此接口获取订单列表，通过参数区别所有订单/待付款/未发货订单/待收货订单。支付分页。
//订单类型（可选，默认所有订单。可选参数：all = 所有，unpaid=待付款，unshipped = 未发货，shipped = 已发货）
+(void)getAccountOrdersListOrderType:(NSString*)type page:(NSString*)page didFinishLoaded:(accountOrdersModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-订单详情
+(void)getOrderDetailOrderID:(NSString*)orderID didFinishLoaded:(orderDetailModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-确认收货
+(void)comfirmOrder_finishOrdierID:(NSString*)orderID didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-获取物流详情
+(void)getExpressDetailOrderID:(NSString *)orderID didFinishLoaded:(expressInfoModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-个人中心-添加商品评论
+(void)addReviewOrder_product_id:(NSString*)Order_product_id product_id:(NSString*)product_id review:(NSString*)review rating:(NSString*)rating didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-修改昵称
+(void)changeFirstName:(NSString*)firstname didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-修改性别
+(void)changeGender:(NSString*)gender didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-有未支付的订单(status_id=0)，用户可以选择取消。Status_id != 0的订单无法取消。
+(void)cancelOrder_ID:(NSString*)order_id didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-有未支付的订单(status_id=0)，用户可以选择继续支付。点击继续支付按钮里，请调用此接口返回支付方式的参数。客户端根据支付方式code调用对应的支付SDK。注：继续支付的订单不支持更换支付方式。
+(void)orderPayOrder_id:(NSString*)order_id didFinishLoaded:(orderPayModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-在订单列表上，点击确认收货，传递 order_id 完成确认收货
+(void)confirmOrder_finishOrder_ID:(NSString*)order_id didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-优惠券
+(void)getCouponListFinishLoaded:(couponListModel)finish didFailLoaded:(didFailLoaded)fail;
//获取结算时的优惠券列表
+(void)getCheckoutCouponListFinishLoaded:(couponListModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-获取产品详情
+(void)getProductDetailInfo:(NSString *)productId didFinishLoaded:(productDetailModel)finish didFailLoaded:(didFailLoaded)fail;
//获取产品评论列表
+(void)getProductCommentList:(NSString *)productId pageNumber:(NSInteger)page didFinishLoaded:(commentListModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-加入购物车
+(void)addProductToShopBag:(NSString *)productId quantity:(NSInteger)quantity options:(NSDictionary *)option didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-购物车
+(void)getProductNumberInCart:(cartCountModel)finish didFailLoaded:(didFailLoaded)fail;
+(void)getCardListDidfinishLoaded:(cartListModel)finish didFailLoaded:(didFailLoaded)fail;
+(void)deleteProductIncard:(NSString *)cartId didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)selectProductToPay:(NSString *)cartId didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)unSelectProductToPay:(NSString *)cartId didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)updateProductQuantityInCart:(NSString *)cartId quantity:(NSInteger)quantity didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)selectAllProductToCart:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)unSelectAllProductToCart:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark--结算
+(void)setShippingAddress:(NSString *)addressId didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)setShippingCoupon:(NSString *)couponCode didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)deleteShippingCouponDidFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)setPayment:(NSString *)pay didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)confirmOrderDidFinishLoaded:(orderConfirmModel)finish didFailLoaded:(didFailLoaded)fail;
+(void)getCheckoutInfoDidFinishLoaded:(checkoutModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-立即购买
+(void)purchaseProduct:(NSMutableDictionary *)dictionary didFinishLoaded:(checkoutModel)finish didFailLoaded:(didFailLoaded)fail;
+(void)getProductPrice:(NSMutableDictionary *)dictionary didFinishLoaded:(productPriceModel)finish didFailLoaded:(didFailLoaded)fail;
#pragma mark-收藏商品
+(void)addProductToWishList:(NSString *)productId didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)deleteProductFromWishList:(NSString *)productId didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;

#pragma mark-上传吐槽图片
+(void)upLoadTuCaoImages:(NSString*)imagePath didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;

+(void)addTuCaoMobile:(NSString*)mobile content:(NSString*)content images:(NSArray*)images didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;

+(void)upLoadHeadImage:(NSString *)imagePath didFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
+(void)getSplashDidFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
/**
 *  获取当前app版本
 */
+(void)getCurrentVersionDidFinishLoaded:(didFinishLoaded)finish didFailLoaded:(didFailLoaded)fail;
@end
